Conditions | 2 |
Total Lines | 14 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { |
||
29 | |||
30 | @Put(':id') |
||
31 | @Roles(UserRole.PHOTOGRAPHER) |
||
32 | @ApiOperation({ summary: 'Update shipping cost' }) |
||
33 | public async index(@Param() idDto: IdDTO, @Body() dto: ShippingCostDTO) { |
||
34 | try { |
||
35 | const { price, weight } = dto; |
||
36 | const id = await this.commandBus.execute( |
||
37 | new UpdateShippingCostCommand(idDto.id, weight, price) |
||
38 | ); |
||
39 | |||
40 | return { id }; |
||
41 | } catch (e) { |
||
42 | throw new BadRequestException(e.message); |
||
43 | } |
||
46 |